<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title Page</title>


    <script src="./global.js"></script>
    <!-- Bootstrap CSS -->
    <link href="./lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">

    
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>

<body>
    <div id="app" class="container-fluid">


        <div class="jumbotron">
            files...
        </div>
      

        
        

        <a class="btn btn-success" target="_blank" href="upload.html" role="button">add</a>
        
        
        
        <div class="row" >
            
            <table class="table table-condensed table-hover">
              
                <tbody>
                    <tr v-for="(item, index) in fileList" :key="index">
                        <td>
                            
                            <button type="button" @click="fnShowOpenModal(item)" class="btn btn-link">{{item.aac001}} <span class="badge">{{item.ctime}}</span></button>
                            
     
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        
        

        

  
    </div>
   <!-- jQuery -->
   <script src="./lib/jquery.min.js"></script>

    <!-- <script type="text/javascript">
        Dropzone.autoDiscover = false;
        var myDropzone = new Dropzone("#myDropzone", {
            url: `${config.remoteUrl}/files/new-upload`,
            addRemoveLinks: true,
            method: 'post',
            filesizeBase: 1024,
            sending: function(file, xhr, formData) {
                formData.append("filesize", file.size);
            },
            success: function (file, response, e) {
                var res = JSON.parse(response);
                if (res.error) {
                    $(file.previewTemplate).children('.dz-error-mark').css('opacity', '1')
                }
            }
        });
    </script> -->

 
    <!-- Bootstrap JavaScript -->
    <script src="./lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</body>

</html>


<script src="./lib/vue.min.js"></script>



<script>

    var vm = new Vue({
        el: '#app',
        data: {
            
          
            fileList: [
             
            ]
        },
        methods: {
           
            getfileList() {

                var that = this;
                fetch(`${config.remoteUrl}/files?size=1000&sort=ctime,desc`)
                    .then(function (response) {
                        return response.json();
                    })
                    .then(function (myJson) {
                        if (myJson.code == 0) {
                            that.fileList = myJson.dat.content;
                        }
                    });
            },
          
            fnShowOpenModal(item) {

               window.open(`${config.remoteUrl}/uploads/${item.aac002}`);

            },

        },
        mounted() {
            this.getfileList();
            // this.getArticleList();
        },
    });

</script>